﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;

public partial class Manage_Service_getexamscore : ManagePageBase
{
    int id = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request.QueryString["id"])) {
            if (!int.TryParse(Request.QueryString["id"], out id)) {
                Response.Write(""); Response.End();
            }
        }
        if (!IsPostBack) {
            string a = getexamscore(id);
            Response.Write(a); Response.End();
        }
    }

    private string getexamscore(int id) {
        DataTable dt = new Exam.Core.DAL.StudentExam().getStuScoreList(id);
        StringBuilder sb = new StringBuilder();
        StringBuilder sb1 = new StringBuilder();
        foreach (DataRow dr in dt.Rows) {
            sb.Append(dr["TotalScorePer"].ToString().Trim());
            sb.Append(",");
            sb1.Append(dr["StudentName"].ToString().Trim());
            sb1.Append(",");
        }
        string result = sb.ToString().Trim(',') + "|" + sb1.ToString().Trim(',');
        return result;
    }
}